# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=milkytracker
pkgver=1.04.00
pkgrel=1
pkgdesc="music tracker inspired by fast tracker 2"
url="https://milkytracker.titandemo.org/"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	alsa-lib-dev
	cmake
	rtmidi-dev
	samurai
	sdl2-dev
	zziplib-dev
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/milkytracker/MilkyTracker/archive/refs/tags/v$pkgver.tar.gz
	fix-crash.patch
	"
builddir="$srcdir/MilkyTracker-$pkgver"
options="!check" # no testsuite

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
5a41fa07d51880e220f15ff3f50e73b999931c875d31e627233669f5a07dfd38621478b8ec27b2242aa4ae6143a0d2ad51627a366fd366256331b71c47ad25da  milkytracker-1.04.00.tar.gz
e9c4d0fd2198b4fc184551226f72d1cfc9b0f946c0f40872dbf19b690d94508b480e1db7ea9ae9ade92769b15fd0886ebc176f6f057f37c48fec95a1d4a7d6f7  fix-crash.patch
"
